package 里氏代换原则.classes;

public class Rectangle
	{
		private int length; //长
		private int width;	//宽


		public int getLength() {
			return length;
		}

		public void setLength(int length) {
			this.length = length;
		}

		public int getWidth() {
			return width;
		}

		public void setWidth(int width) {
			this.width = width;
		}
		
		//显示
		public void display()
		{
			System.out.printf("长：%d 宽：%d%n",length,width);
		}
		
		//扩展宽度
		public void extendWidth()
		{
			while(width != length-1)
			{
				width+=1;
			}
		}
	}